package com.tencent.shadow.sample.plugin.app2.lib;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

/**
 * 插件2的主活动页面
 */
public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        // 获取按钮并设置点击事件
        Button btnToSecond = findViewById(R.id.btn_to_second);
        btnToSecond.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳转到第二个页面
                Intent intent = new Intent(MainActivity.this, SecondActivity.class);
                startActivity(intent);
            }
        });
        
        // 显示一个简单的提示消息，表示插件2已经加载成功
        Toast.makeText(this, "插件2已成功加载", Toast.LENGTH_SHORT).show();
    }
} 